.custom-project-templates
  - if @custom_project_templates.present?
    - @custom_project_templates.each do |template|
      .template-option.d-flex.align-items-center{ data: { testid: 'template-option-container' } }
        .avatar-container.s40
          = project_icon(template, alt: template.name, class: 'btn-template-icon avatar s40 avatar-tile', lazy: false)
        .description
          %strong
            = template.title
          %br
          .text-muted
            = template.description
        .controls.d-flex.align-items-baseline
          = render Pajamas::ButtonComponent.new(button_options: { class: 'gl-mr-3', href: project_path(template), rel: 'noopener noreferrer', target: '_blank' }) do
            = _('Preview')
          %label.btn.gl-button.btn-confirm.custom-template-button.choose-template.gl-mb-0{ for: template.name }
            %input{ type: "radio", autocomplete: "off", name: "project[template_project_id]", id: template.name, value: template.id, data: { template_name: template.name } }
            %span{ data: { testid: 'use-template-button' } }
              = _('Use template')
    = paginate @custom_project_templates, params: { controller: 'users', action: 'available_project_templates', username: current_user.username }, theme: 'gitlab', remote: true
  - else
    .bs-callout.bs-callout-warning
      %p
        = _("There are no custom project templates set up for this GitLab instance. They are enabled from GitLab's Admin Area. Contact your GitLab instance administrator to setup custom project templates.")

      = render Pajamas::ButtonComponent.new(href: help_page_path("administration/custom_project_templates")) do
        = _("Learn more about custom project templates")
